#docker build --no-cache -t php-fpm:8.0.3 .

FROM php:8.0.3-fpm
MAINTAINER chenzhiwei "chenzhiweiwk@qq.com"

# 设置时区
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

#配置文件
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

#更换数据源
COPY sources.list /etc/apt/sources.list

# 更新安装依赖包和PHP核心拓展
RUN apt-get update && apt-get install -y \
       libfreetype6-dev \
       libjpeg62-turbo-dev \
       libpng-dev \
       libzip-dev \
       libcurl4-openssl-dev \
   && docker-php-ext-configure gd --with-freetype --with-jpeg \
   && docker-php-ext-install -j$(nproc) gd \
   && docker-php-ext-install zip \
   && docker-php-ext-install pdo_mysql \
   && docker-php-ext-install opcache \
   && docker-php-ext-install mysqli \
   && docker-php-ext-install curl \
   && rm -r /var/lib/apt/lists/*

WORKDIR /var/www/html

# Write Permission
RUN usermod -u 1000 www-data

